home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
gui4cli
/
docs
/
tutorials
/
textin.gc
< prev
next >
Wrap
Text File
|
1999-05-14
|
2KB
|
72 lines
G4C
; -----------------------------------------------------------
; xTEXTIN gadget example (setting of Attributes etc)
; -----------------------------------------------------------
WINBIG 170 70 283 102 'TextIn Attributes'
WinType 11110001
xOnLoad
GuiOpen #This
xOnClose
GuiQuit #This
Box 0 0 0 0 out button
; -----------------------------------------------------------
; 4 simple textin gadgets with the TITYPE attribute set
; -----------------------------------------------------------
XTEXTIN 81 3 195 15 "Int" txt "" 100
gadid 1
attr titype int
XTEXTIN 81 18 195 15 "Float" txt "" 100
gadid 2
attr titype float
XTEXTIN 81 33 195 15 "Hex" txt "" 100
gadid 3
attr titype hex
XTEXTIN 81 48 195 15 "Upper" txt "" 100
gadid 4
attr titype upper
; -----------------------------------------------------------
; Set the type dynamically
; -----------------------------------------------------------
XCYCLER 9 66 92 15 "" type
CSTR Normal STRING
CSTR Int INT
CSTR Float FLOAT
CSTR Hex HEX
CSTR Date DATE
CSTR Upper UPPER
CSTR Lower LOWER
; set the type of the textin gad below.
setattr textin.gc/5 TITYPE $type
XTEXTIN 105 66 172 16 "" txt "" 100
gadid 5
; this starts off as normal (i.e. enter anything)
; -----------------------------------------------------------
; Print some info on the current textin gadget
; -----------------------------------------------------------
XBUTTON 195 84 81 14 "Info"
ezreq 'Cursor position: $$ti.pos\nText length: $$ti.length\nAddress: $$ti.gui $$ti.id\n' OK ''